package com.xxlie.auth.repository;

import com.xxlie.core.common.StatusConstant;
import com.xxlie.auth.domain.Setting;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface SettingRepository extends JpaRepository<Setting, Long> {
    Setting findOne(Long id);

    void deleteById(Long id);

	@Query("select a from Setting a where a.name=:name and delFlag = '" + StatusConstant.DEL_FLAG_NORMAL + "'" )
    Setting findByName(@Param("name") String name);

    Setting save(Setting setting);
}
